package res

import "NovelBook/models/db_models"

// UserInfo 用户信息
type UserInfo struct {
	ID uint `json:"id"`
	// 账户
	Account string `json:"account" binding:"required"`
	// 邮箱
	Email string `json:"email" binding:"required"`
	// 昵称
	Username string `json:"username" binding:"required"`
	// 头像
	Avatar string `json:"avatar" binding:"required"`

	// 密码 返回信息中不可见
	Password string `json:"-" binding:"required"`
}

type RegisterInfo struct {
	User db_models.UserInfo `json:"user"  binding:"required"`
	// 验证码
	Captcha string `json:"captcha"  binding:"required"`
}

// 两种情况的登录

type AccountPassword struct {
	Account  string `json:"account" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type EmailPassword struct {
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
}

// UserToken 登录成功后的信息
type UserToken struct {
	User  UserInfo `json:"user"`
	Token string   `json:"token"`
}

// UserAvatar 昵称和头像
type UserAvatar struct {
	Username string `json:"username"`
	Avatar   string `json:"avatar"`
}

// ResetInfo 重置密码信息
type ResetInfo struct {
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
	Captcha  string `json:"captcha"  binding:"required"`
}
